package com.teacold.tfactivity.video.provider;

import android.content.ContentProvider;
import android.content.ContentResolver;
import android.content.Context;
import android.database.Cursor;
import android.provider.MediaStore;
import android.view.View;

import com.teacold.tfactivity.video.bean.VideoBean;
import com.teacold.tfactivity.video.inteface.AbstructProvider;

import java.util.ArrayList;
import java.util.List;

public class VideoProvider implements AbstructProvider{
    private Context mContext;

    public VideoProvider(Context mContext) {
        this.mContext = mContext;
    }

    @Override
    public List<?> getList() {
        List<VideoBean> list;
        ContentResolver contentProvider=mContext.getContentResolver();
        Cursor cursor=contentProvider.query(MediaStore.Video.Media.EXTERNAL_CONTENT_URI,null,null,null,null);
        if(cursor!=null){
            list=new ArrayList<>();
            while (cursor.moveToNext()){
                int id=cursor.getInt(cursor.getColumnIndexOrThrow(MediaStore.Video.Media._ID));
               String title=cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Video.Media.TITLE));
               String album=cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Video.Media.ALBUM));
               String artist=cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Video.Media.ARTIST));
               String displayName=cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Video.Media.DISPLAY_NAME));
               String mimeType=cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Video.Media.MIME_TYPE));
               String path=cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Video.Media.DATA));


            }



        }




        return null;
    }
}
